package com.AJava1710D.bingfabao.sympho;

import java.util.concurrent.Semaphore;

/**
 * 作者: LCG
 * 日期: 2020/6/23 11:52
 * 描述:
 */
public class TestSympho {

    public static void main(String[] args) {

        Semaphore semaphore=new Semaphore(2);

        TestRun3 testRun31=new TestRun3(semaphore,2000);
        TestRun3 testRun32=new TestRun3(semaphore,2000);
        TestRun3 testRun33=new TestRun3(semaphore,2000);
        TestRun3 testRun34=new TestRun3(semaphore,2000);

        Thread thread1=new Thread(testRun31,"A运动员");
        Thread thread2=new Thread(testRun32,"B运动员");
        Thread thread3=new Thread(testRun33,"C运动员");
        Thread thread4=new Thread(testRun34,"D运动员");

        thread1.start();
        thread2.start();
        thread3.start();
        thread4.start();


    }

}
